home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / gprof / gpfsrc09.zoo / st-out.h < prev    next >
C/C++ Source or Header  |  1991-06-27  |  2KB  |  64 lines

  1. /*    atst.out.h    .1    24Dec85    */
  2. /*
  3.  * Header prepended to each Atari ST .prg file
  4.  */
  5. #ifndef _STAOUT_H
  6. #define _STAOUT_H
  7.  
  8. struct aexec {
  9.      short    a_magic;    /* magic number */
  10. unsigned long    a_text;        /* size of text segment */
  11. unsigned long    a_data;        /* size of initialized data */
  12. unsigned long    a_bss;        /* size of uninitialized data */
  13. unsigned long    a_syms;        /* size of symbol table */
  14. unsigned long    a_AZero1;    /* always zero */
  15. unsigned long    a_ldflgs;    /* program load flags */
  16. #define a_AZero2 a_ldflgs    /* compatibility */
  17. unsigned short    a_isreloc;    /* is reloc info present */
  18. };
  19. #define    CMAGIC    0x601A        /* contiguous text */
  20. #define    ISRELOCINFO    0    /* relocation information is present */
  21.                 /*  any other value - no reloc info  */
  22. /*
  23.  * Macros which take exec structures as arguments and tell whether
  24.  * the file has a reasonable magic number or offsets to text|symbols|strings.
  25.  */
  26. #define    A_BADMAG(x)     (((x).a_magic)!=CMAGIC)
  27. /* this is busted...
  28. #define    A_TXTOFF(x)    ((x).a_magic==ZMAGIC ? 1024 : sizeof (struct exec))
  29. */
  30. #define    A_TXTOFF(x)    (sizeof (struct aexec))
  31. #define A_DATOFF(x)    (A_TXTOFF(x) + (x).a_text)
  32. #define A_SYMOFF(x)    (A_TXTOFF(x) + (x).a_text+(x).a_data)
  33. #define    A_STROFF(x)    (A_SYMOFF(x) + (x).a_syms)
  34.  
  35. /*
  36.  * Format of a symbol table entry
  37.  */
  38. struct    asym 
  39.     {
  40.     union {
  41.         char        a_name[8];    /* symbol name in file */
  42.         char        *ptr;        /* symbol name in core */
  43.     } n_un;
  44.         
  45.     unsigned short    a_type;        /* type flag, i.e. N_TEXT etc; see below */
  46.     unsigned long    a_value;    /* value of this symbol (or sdb offset) */
  47.     };
  48.  
  49. /*
  50.  * Simple values for a_type.
  51.  */
  52. #define A_UNDF    0        /* ?? for gas */
  53. #define    A_BSS    0x0100        /* bss */
  54. #define    A_TEXT    0x0200        /* text */
  55. #define    A_DATA    0x0400        /* data */
  56. #define    A_EXT    0x0800        /* external */
  57. #define A_EQREG    0x1000        /* equated register */
  58. #define A_GLOBL    0x2000        /* global */
  59. #define A_EQU    0x4000        /* equated */
  60. #define A_DEF    0x8000        /* defined */
  61. #define A_LNAM  0x0048        /* gst compat long name */
  62.  
  63. #endif /* _STAOUT_H */
  64.